/*
day175
2020.2.19
*/ 
#include<vector>
#include<iostream>
using namespace std;

class Solution {
public:
    int wiggleMaxLength(vector<int>& nums) {
        int N = nums.size();
        if (N < 2) return N;
        int prev = 0;
        int res = 1;
        for (int i = 1; i < N; ++i) {
            if (nums[i] == nums[i - 1]) continue;
            int curr = (nums[i] > nums[i - 1]) ? 1 : -1;
            res += curr != prev;
            prev = curr;
        }
        return res;
    }
};

int main()
{
	return 0;
}
